import request from '@/utils/request'
import data from '@/views/system/dict/data.vue'
import order from '@/views/shop/order/index.vue'

// 查询商品订单列表列表
export function listOrder(query) {
  return request({
    url: '/shop/order/list',
    method: 'get',
    params: query
  })
}

// 查询商品订单列表详细
export function getOrder(id) {
  return request({
    url: '/shop/order/' + id,
    method: 'get'
  })
}

// 新增商品订单列表
export function addOrder(data) {
  return request({
    url: '/shop/order',
    method: 'post',
    data: data
  })
}

// 修改商品订单列表
export function updateOrder(data) {
  return request({
    url: '/shop/order',
    method: 'put',
    data: data
  })
}

// 删除商品订单列表
export function delOrder(id) {
  return request({
    url: '/shop/order/' + id,
    method: 'delete'
  })
}

// 查询商品订单列表详细
export function getOrderDetails() {
  return request({
    url: '/shop/order/selectOrderDetails',
    method: 'get'
  })
}

//查询订单参数过滤
/* http://localhost:8083/shop/order/selectDetailsByDto */
export function selectDetailDto(data){
  return request({
    url: '/shop/order/selectDetailsByDto',
    method:'get',
    params:data
  })
}

//点击确认收货之后更改状态
export function updateOrderStatus(data){
  return request({
    url: '/shop/order/updateOrderStatus',
    method:'put',
    data:data
  })
}


//点击确认收货之后更改状态
export function updateOrderPay(data){
  return request({
    url: '/shop/order/updateOrderPay',
    method:'put',
    data:data
  })
}

// 查询商品订单列表详细,过滤出
export function getOrderByPayStatus(payStatus) {
  return request({
    url: '/shop/order/listObligation/'+payStatus,
    method: 'get'
  })
}

///pendingShipment/{orderStatus}

//查询商品订单列表过滤订单状态
export function getOrderByOrderStatus(orderStatus) {
  return request({
    url: '/shop/order/pendingShipment/'+orderStatus,
    method: 'get'
  })
}

///details/{orderId}

//根据订单id查询订单详情
export function getOrderDetailByOrderId(orderId){
  return request({
    url: '/shop/order/details/'+orderId,
    method: 'get'
  })
}

